package org.embedchat.protocol.codec;

import org.embedchat.protocol.codec.client.LoginMessageDecoder;
import org.embedchat.protocol.codec.client.LoginMessageEncoder;
import org.embedchat.protocol.codec.client.RoomsListRequestMessageDecoder;
import org.embedchat.protocol.codec.client.RoomsListRequestMessageEncoder;
import org.embedchat.protocol.codec.common.TextMessageDecoder;
import org.embedchat.protocol.codec.common.TextMessageEncoder;
import org.embedchat.protocol.codec.server.ErrorMessageDecoder;
import org.embedchat.protocol.codec.server.ErrorMessageEncoder;
import org.embedchat.protocol.codec.server.RoomsListMessageDecoder;
import org.embedchat.protocol.codec.server.RoomsListMessageEncoder;
import org.embedchat.protocol.codec.server.UsersListMessageDecoder;
import org.embedchat.protocol.codec.server.UsersListMessageEncoder;

import org.apache.mina.filter.codec.demux.DemuxingProtocolCodecFactory;

public class ChatProtocolCodecFactory extends DemuxingProtocolCodecFactory {

    public ChatProtocolCodecFactory(boolean server) {
        super.register(TextMessageDecoder.class);
        super.register(TextMessageEncoder.class);
        super.register(LoginMessageDecoder.class);
        super.register(LoginMessageEncoder.class);
        super.register(ErrorMessageDecoder.class);
        super.register(ErrorMessageEncoder.class);
        super.register(RoomsListMessageDecoder.class);
        super.register(RoomsListMessageEncoder.class);
        super.register(RoomsListRequestMessageDecoder.class);
        super.register(RoomsListRequestMessageEncoder.class);
        super.register(UsersListMessageDecoder.class);
        super.register(UsersListMessageEncoder.class);
    }
}
